//
//  MYShopSalesOrderConfirmPayView.swift
//  MuYing
//
//  Created by tbb on 2019/7/31.
//  Copyright © 2019 TBB. All rights reserved.
//

import UIKit

class MYShopSalesOrderConfirmPayView: MYShopSalesOrderBasePayView {
    lazy var priceLb: UILabel = {
        let priceLb = UILabel();
        priceLb.textColor = appMainTitleColor;
        priceLb.font = UIFont.systemFont(ofSize: 24, weight: .regular);
        priceLb.textAlignment = .center;
        priceLb.text = "---";
        return priceLb;
    }()
    
    lazy var typePayBtn: QMUIButton = {
        let typePayBtn = QMUIButton(type: .custom);
        typePayBtn.isEnabled = false;
        self.typePayBtn = typePayBtn;
        typePayBtn.setTitle("---", for: .normal);
        typePayBtn.imagePosition = .right;
        typePayBtn.spacingBetweenImageAndTitle = 8;
        typePayBtn.setImage(UIImage(named: "ShopDetails_more_icon"), for: .normal);
        typePayBtn.titleLabel?.font = UIFont.systemFont(ofSize: 14, weight: .medium);
        typePayBtn.setTitleColor(appMainTitleColor, for: .normal)
        typePayBtn.titleLabel?.sizeToFit();
        typePayBtn.sizeToFit();
        return typePayBtn
    }()
    
    lazy var bgView: UIView = {
        let bgView = UIView();
        let typeLb = UILabel();
        typeLb.textColor = UIColorFromHex(rgbValue: 0xC3C3C3);
        typeLb.font = UIFont.systemFont(ofSize: 14, weight: .medium)
        typeLb.text = kYQLSSwift("支付方式");
        bgView.addSubview(typeLb);
        typeLb.mas_makeConstraints({ (make) in
            make?.left.mas_equalTo()(16);
            make?.centerY.mas_equalTo()(0);
            make?.height.mas_equalTo()(20);
            make?.width.mas_equalTo()(60);
        })
        
        let lineView = UIView();
        lineView.backgroundColor = UIColorFromHex(rgbValue: 0xF2F2F2);
        bgView.addSubview(lineView);
        lineView.mas_makeConstraints({ (make) in
            make?.left.mas_equalTo()(16);
            make?.right.mas_equalTo()(0);
            make?.bottom.mas_equalTo()(0);
            make?.height.mas_equalTo()(1);
        })
        
       
        bgView.addSubview(self.typePayBtn);
        self.typePayBtn.mas_makeConstraints({ (make) in
            make?.right.mas_equalTo()(-24);
            make?.centerY.mas_equalTo()(0);
            make?.height.mas_equalTo()(20);
//            make?.left.mas_equalTo()(typeLb.mas_right)?.mas_equalTo()(12);
        })
        
        return bgView
    }()
    
    override func layoutSubviews() {
        super.layoutSubviews();
        self.addSubview(self.priceLb);
        self.priceLb.mas_makeConstraints { (make) in
            make?.top.mas_equalTo()(self.topLineView.mas_bottom)?.mas_equalTo()(14);
            make?.height.mas_equalTo()(33);
            make?.centerX.mas_equalTo()(0);
        }
        
        self.addSubview(self.bgView);
        self.bgView.mas_makeConstraints { (make) in
            make?.top.mas_equalTo()(self.priceLb.mas_bottom)?.mas_equalTo()(12);
            make?.left.mas_equalTo()(0);
            make?.right.mas_equalTo()(0);
            make?.height.mas_equalTo()(44);
            
        }
    }
 
}
